<?php
//<=============================Bean developpé par MEZOUARI KHALID>======================//
    require_once("beans/userBean.php");
 class userDao{
   function loadUser($user) {
         $login=$user->getLogin();
          $requete_prepare_1=connexion()->prepare("SELECT * FROM user WHERE login ='$login' "); // on prépare notre requête
          $requete_prepare_1->execute();
          $usser=new userBean();
          while($lignes=$requete_prepare_1->fetch(PDO::FETCH_OBJ)){
                $usser=$lignes;
          }
          return $usser;
  }
public function insertUser($user){
     $login=$user->getLogin();
     $password=$user->getPassword();
      $requete_insert=connexion()->exec("insert into user(login,password) values('$login','$password')");
  }
}
?>

